package util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 生成文件名，无序数字加上时间
 */
public class GenerateFileName {

    public static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");

    public static String generateFileName(){
        StringBuffer fileName=new StringBuffer();
        Date newTime = new Date();
        // 给定模式
        fileName.append(sdf.format(newTime));
        fileName.append(String.valueOf((int)( Math.random() * 10000)));
        return fileName.toString();
    }


}
